package com.smh.a05ThreadDemo5;

public class TreadMethod1 {
    public static void main(String[] args) {

        MyRunnable r = new MyRunnable();

        Thread thread = new Thread(r);
        thread.setName("asd");
        thread.setPriority(10);//优先级默认是五,最大是10,最小是1
        thread.start();
        MyRunnable r2 = new MyRunnable();

        Thread thread2 = new Thread(r2);
        thread2.setPriority(1);//优先级默认是五,最大是10
        thread2.start();
        System.out.println(Thread.currentThread().getPriority());//main方法也是五
        //概率问题,不是谁优先级高谁就一定先执行完.


    }
}
